<template>
  <div class="sumsale-box">
    <div class="sumsale-item">
      <div>合伙人总销量</div>
      <div>{{ sumsale1 }}</div>
    </div>
    <div class="sumsale-item">
      <div>大客户总销量</div>
      <div>{{ sumsale2 }}</div>
    </div>
  </div>
</template>

<script>
import { getCopartnerdatas} from "../../api/datas";
export default {
  data() {
    return {
      sumsale1: "",
      sumsale2: "",
    };
  },
  mounted(){
    this.getAllDatas();
  },
  methods:{
     getAllDatas() {
      getCopartnerdatas({}).then((res) => {
        for(let item of res.partners){
          this.sumsale1 += item.sale;
        }
        for(let item of res.counts){
          this.sumsale2 += item.sale;
        }
      });
    },
  }
};
</script>

<style lang="less" scoped>
.select-box,
.sumsale-box {
  display: flex;
  margin: 30px;
}
.sumsale-item {
  padding: 30px;
  margin-right: 50px;
  border-radius: 5px;
}
.sumsale-item:hover{
  box-shadow: 1px 2px 6px 2px #d4cdcd;
  background-color: #f3f3f3;
}
</style>